<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@include file="/pageRc/common/common.jsp"%>

<!DOCTYPE html>
<html lang="en" style="overflow-x: hidden">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport"
	content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="msapplication-tap-highlight" content="no">

<link rel="stylesheet" href="<%=commonPath%>/pageRc/layui/css/layui.css"
	media="all">
<script type="text/javascript"
	src="<%=commonPath%>/pageRc/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript"
	src="<%=commonPath%>/pageRc/common/utils.js"></script>
<script type="text/javascript"
	src="<%=commonPath%>/pageRc/common/msgTool.js"></script>
<script type="text/javascript"
	src="<%=commonPath%>/pageRc/layui/layui.js"></script>

<title>项目奖励表</title>

<script>
	$(function(){

 	})
	//注意：选项卡 依赖 element 模块，否则无法进行工能性操作
	layui.use('element', function() {
		var element = layui.element();

		//…
	});
</script>
<jsp:include page="publicMethod.jsp" />
</head>
<body class="layui-main" style="width: 100%;">
	<blockquote class="layui-elem-quote">项目奖励表</blockquote>
	<div id="createMsgForm" name="createMsgForm" class="layui-form">
		<div class="layui-form-item">
			<div class="layui-inline">
				<div class="layui-inline">
					<select name="proGroupNo" id="proGroupNo"
						lay-filter="proGroupSelect" style="width: 210;">
						<c:forEach items="${groupList}" var="group">
							<option value="${group.proGroupNo}">${group.proGroupName}</option>
						</c:forEach>
					</select>
				</div>
				<div class="layui-inline">
					<select name="proTeamNo" id="proTeamNo" style="width: 210;">
						<option value="">项目组名称</option>
						<option value="">全部</option>
						<c:forEach items="${teanList}" var="tean">
							<option value="${tean.proTeamNo}">${tean.proTeamName}</option>
						</c:forEach>
					</select>
				</div>
				<div class="layui-inline">
					<input class="layui-input" style="width: 210" id="needName"
						placeholder="需求名称">
				</div>
				<div class="layui-inline">-</div>
				<div class="layui-inline">
					<button class="layui-btn" type="button" data-method="doSearchSum">查询</button>
				</div>
				<div class="layui-inline">
					<form method="post" action= "<%=commonPath%>/page/main/load.do">            
			              <button class="layui-btn" name="button"  lay-filter="formLogin" lay-submit>下载excel</button>
			        </form>
				</div>
			</div>
		</div>


		<div class="layui-form-item">
			<div class="layui-inline">
				<input class="layui-input" style="width: 210" id="startDate"
					value="${sysdate}"
					onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
					placeholder="报工日期从">
			</div>
			<div class="layui-inline">
				<input class="layui-input" style="width: 210" id="endDate"
					value="${sysdate}"
					onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
					placeholder="到">
			</div>
			<div class="layui-inline">
				<div class="layui-inline">
					<input class="layui-input" style="width: 210" id="needNo"
						placeholder="需求编号">
				</div>
				<div class="layui-inline">
					<input class="layui-input" style="width: 210" id="total"
						placeholder="总分数">
				</div>
			</div>
		</div>

		<div class="layui-tab">
			<ul class="layui-tab-title">
				<li class="layui-this">项目奖励表</li>
				<li class="">评估表</li>
				<li class="">项目毛利表</li>
			</ul>
			
			<div class="layui-tab-content">
		
			<div class="layui-tab-item layui-show">
				<div class="layui-form-item" id="dateDiv1">
					<div class="layui-inline">
						<table class="layui-table" lay-even="" lay-skin="line"
							style="text-align: center; width: 100%;">
							<colgroup align="center">
								<col width="5%">
								<col width="10%">
								<col width="10%">
								<col width="10%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
							</colgroup>
							<thead>
								<tr>
									<th>团队名称</th>
									<th>项目组</th>
									<th>需求编号</th>
									<th>需求名称</th>
									<th>项目毛利</th>
									<th>综合得分</th>
									<th>对应奖金等级</th>
									<th>奖金金额</th>
								</tr>
							</thead>
							<tbody id="detailDiv1">

							</tbody>
							<script id="tplSrc1" type="text/html">
							 {{#  layui.each(d.body, function(index, x){}}
							     <tr align="left">
								   <td>{{x.proGroupName==undefined?'':x.proGroupName}}</td>
								   <td>{{x.proTeamName==undefined?'':x.proTeamName}}</td>
								   <td><a href="javascript:void(0)" onclick="searchByNeedId('{{x.needId}}')"><u>{{x.needNo==undefined?'':x.needNo}}</u></a></td>
								   <td>{{x.needName==undefined?'':x.needName}}</td>
								   <td></td>	
								   <td></td>	
								   <td></td>	
								   <td></td>	
 							    </tr>
							{{#  }); }} 
					   </script>
						</table>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline">
						<div id="laypageDiv1"></div>
					</div>
				</div>
			</div>
			
			<div class="layui-tab-item">
				<div class="layui-form-item" id="dateDiv2">
					<div class="layui-inline">
						<table class="layui-table" lay-even="" lay-skin="line"
							style="text-align: center; width: 100%;">
							<colgroup align="center">
								<col width="5%">
								<col width="15%">
								<col width="15%">
								<col width="15%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
							</colgroup>
							<thead>
								<tr>
									<th>团队名称</th>
									<th>项目组</th>
									<th>需求编号</th>
									<th>需求名称</th>
									<th>系统核定金额</th>
									<th>需求消耗人月</th>
									<th>人均产值</th>
									<th>得分</th>
									<th>人员结构比例</th>
									<th>得分</th>
									<th>甲方评分</th>
									<th>得分</th>
									<th>综合得分</th>
								</tr>
							</thead>
							<tbody id="detailDiv2">

							</tbody>
							<script id="tplSrc2" type="text/html">
					 {{#  layui.each(d.body, function(index, x){}}
					     <tr align="left">
						   <td>{{x.proGroupName==undefined?'':x.proGroupName}}</td>
						   <td>{{x.proTeamName==undefined?'':x.proTeamName}}</td>
						   <td><a href="javascript:void(0)" onclick="searchByNeedId('{{x.needId}}')"><u>{{x.needNo==undefined?'':x.needNo}}</u></a></td>
						   <td>{{x.needName==undefined?'':x.needName}}</td>
						   <td></td>	
						   <td>{{x.needUseTime==undefined?'':x.needUseTime}}</td>	
						   <td>{{x.rydc==undefined?'':x.rydc}}</td>	
						   <td>{{x.dcfz==undefined?'':x.dcfz}}</td>	
						   <td>{{x.needuserscore==undefined?'':x.needuserscore}}</td>
						   <td></td>
						   <td>{{x.grade==undefined?'':x.grade}}</td>
					       <td></td>			
						   <td></td>
						    </tr>
					{{#  }); }} 
			   </script>
						</table>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline">
						<div id="laypageDiv2"></div>
					</div>
				</div>
			</div>
			
			<div class="layui-tab-item">
				<div class="layui-form-item" id="dateDiv3">
					<div class="layui-inline">
						<table class="layui-table" lay-even="" lay-skin="line"
							style="text-align: center; width: 100%;">
							<colgroup align="center">
								<col width="5%">
								<col width="15%">
								<col width="15%">
								<col width="15%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
								<col width="5%">
							</colgroup>
							<thead>
								<tr>
									<th>团队名称</th>
									<th>项目组</th>
									<th>需求编号</th>
									<th>需求名称</th>
									<th>项目金额</th>
									<th>系统核定金额</th>
									<th>税金</th>
									<th>人力成本</th>
									<th>项目费用</th>
									<th>项目毛利</th>
									<th>团队总收入</th>
									<th>团对总人数</th>
									<th>人均产值</th>
									<th>人力成本</th>
								</tr>
							</thead>
							<tbody id="detailDiv3">

							</tbody>
							<script id="tplSrc3" type="text/html">
							 {{#  layui.each(d.body, function(index, x){}}
							     <tr align="left">
								   <td>{{x.proGroupName==undefined?'':x.proGroupName}}</td>
								   <td>{{x.proTeamName==undefined?'':x.proTeamName}}</td>
								   <td><a href="javascript:void(0)" onclick="searchByNeedId('{{x.needId}}')"><u>{{x.needNo==undefined?'':x.needNo}}</u></a></td>
								   <td>{{x.needName==undefined?'':x.needName}}</td>
								   <td>{{x.needUseTime==undefined?'':x.needUseTime*2.5}}</td>	
								   <td></td>	
								   <td ></td>	
								   <td></td>
								   <td></td>
								   <td></td>
								   <td></td>
								   <td></td>
								   <td></td>	
 							    </tr>
							{{#  }); }} 
					   </script>
						</table>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline">
						<div id="laypageDiv3"></div>
					</div>
				</div>
			</div>
		</div>
		</div>
	</div>
	${msg}
	</div>
</body>
<script type="text/javascript">
var path="<%=commonPath%>";
	var msg = new msgTool();
	layui.use(
	[ 'form', 'layer', 'laytpl', 'laypage', 'laydate' ],
	function() {
	var $ = layui.jquery, 
	layer = layui.layer; //独立版的layer无需执行这一句
	var form = layui.form(), 
	layer = layui.layer, 
	laypage = layui.laypage, 
	laytpl = layui.laytpl;
	var active = {
		doSearchSum : function() { //搜索
			var getTpl1 = tplSrc1.innerHTML;
			var getTpl2 = tplSrc2.innerHTML;
			var getTpl3 = tplSrc3.innerHTML;
			var dataObj = {
				"proGroupNo" : $("#proGroupNo").val(),
				"proTeamNo" : $("#proTeamNo").val(),
				"needNo" : $("#needNo").val(),
				"needName" : $("#needName").val(),
				"bgnWorkDate":$("#startDate").val(),
				"endWorkDate":$("#endDate").val(),
				"total" : $("#total").val()
			}
			msg.sendMsg("/page/main/xiangmujiangli.do",
				dataObj,function(data) {
					laytpl(getTpl1).render(data,function(html) {
						detailDiv1.innerHTML = html;
					});
					laytpl(getTpl2).render(data,function(html) {
						detailDiv2.innerHTML = html;
					});
					laytpl(getTpl3).render(data,function(html) {
						detailDiv3.innerHTML = html;
					});
			});
		},
		doExcel : function() {
			var dataObj = {
				"proGroupNo" : $("#proGroupNo").val(),
				"proTeamNo" : $("#proTeamNo").val(),
				"needNo" : $("#needNo").val(),
				"needName" : $("#needName").val(),
				"bgnWorkDate":$("#startDate").val(),
				"endWorkDate":$("#endDate").val(),
				"total" : $("#total").val()
			}
			msg.sendMsg("/page/main/load.do",
					dataObj, function(data) {
						window.location.href = path
						+ "/downFile/"
						+ data.body.fileName
			});
		}
		
		
	}
	$('.layui-btn').on('click',function() {
		var othis = $(this), method = othis.data('method');
		active[method] ? active[method].call(this,othis) : '';
	});
});
	
	function searchByNeedId(needId) {
		layer.open({
			type : 2,
			title : "详细信息",
			area : [ '95%', '95%	' ],
			scrollbar : false,
			content : '<%=commonPath%>/page/main/' + needId+ '/searchDetailByNeedId.do',
			success : function(layero, index) {
			},
			end : function() {
			}
		});
	}
</script>

</html>
